import ajax from './ajax'

const BASE_URL = '/api'
// ---------------------------------------------------------------------------------------------------------------------
// 实时页面接口函数
// 总收入查询
export const getTotalIncome = () => ajax(BASE_URL + '/twoController/PostIncomeInfos', {}, 'POST')
// 服务区信息查询
export const getallserviceArea = () => ajax(BASE_URL + '/fictitious/GetallserviceArea')
// 收费站收入查询
export const getTollIncome = () => ajax(BASE_URL + '/twoController/PostTollboothincome', {}, 'POST')
// 获取分中心小时统计数据
export const getHours = (tollboothidOrCenterid, tollboothtypeOrCentertype, starttime, endtime) => ajax(BASE_URL + '/twoController/Posthours', {
  tollboothidOrCenterid,
  tollboothtypeOrCentertype,
  starttime,
  endtime
}, 'POST')

// ---------------------------------------------------------------------------------------------------------------------
// 统计页面接口函数
// 获取年收入数据
export const getTotalYearIncome = () => ajax(BASE_URL + '/fictitious/GetIncomeInfo')
// 查看分中心数据
export const getBranchInfo = (branchcode) => ajax(BASE_URL + '/fictitious/PostBranch', { branchcode }, 'POST')
// 获取收费站下拉列表函数
export const getTollSelect = () => ajax(BASE_URL + '/fictitious/GetTollboothSelect')
// 获取收费站信息
export const getTollInfo = () => ajax(BASE_URL + '/fictitious/GetTollbooth')
// 获取最近7天内车流量和收入信息
export const getSevenInfo = () => ajax(BASE_URL + '/fictitious/GetCarStatistics')
// 总收入详情查看
export const getDetailIncome = (starttime, endtime) => ajax(BASE_URL + '/twoController/PostIncomeInfos', {
  starttime,
  endtime
}, 'POST')
// 根据服务区编号查看服务区详情
export const getServiceAreaData = (serviceAreacode) => ajax(BASE_URL + '/fictitious/PostServiceArea', { serviceAreacode }, 'POST')
// 根据时间和收费站ID返回收费站信息
export const getTollInfoData = (datetime, tollboothId) => ajax(BASE_URL + '/fictitious/Posttollboothtieminfo', {
  datetime,
  tollboothId
}, 'POST')
// ---------------------------------------------------------------------------------------------------------------------
// 管理模块接口函数
// 获取基础建设列表
export const getBasicBuild = () => ajax(BASE_URL + '/fictitious/GetBasicsWorkList')
// 根据选择的项目名称显示对应信息
export const getBasicBuildInfo = (basicsworkid) => ajax(BASE_URL + '/fictitious/PostBasicsWorkInfo', { basicsworkid }, 'POST')
// 获取实时监控中所有收费站和分中心下拉列表
export const getAllList = () => ajax(BASE_URL + '/fictitious/GetBranchAndServiceAreaAndTollbooth')
// 获取视频地址
export const getVideoUrl = () => ajax(BASE_URL + '/fictitious/Postvideourl', {
  camId: 'CAM1001',
  page: 1,
  pageSize: 2,
  quality: 'h'
}, 'POST')
export const getVideoUrlL = () => ajax(BASE_URL + '/fictitious/Postvideourl', {
  camId: 'CAM1001',
  page: 1,
  pageSize: 2,
  quality: 'l'
}, 'POST')
// 获取系统监控状态
export const getSystemWatch = () => ajax(BASE_URL + '/fictitious/GetSystmemonitor')
// 获取通讯录数据
export const getUserList = () => ajax(BASE_URL + '/fictitious/GetUserList')
// 获取所有事件类型列表
export const getEventType = () => ajax(BASE_URL + '/twoController/GetselectEvenitTypeList')
// 获取具体事件信息
export const getEventInfo = (evenitType, evenitdate) => ajax(BASE_URL + '/fictitious/POSTEventsimpleList', {
  evenitType,
  evenitdate
}, 'POST')
// 根据ID查看具体事件详情
export const getEventDetail = (eventcode) => ajax(BASE_URL + '/fictitious/PostEventinfo', { eventcode }, 'POST')
// 填写反馈信息
export const feedBack = () => ajax(BASE_URL + '/fictitious/PostOpinionmsg', {}, 'POST')

// ---------------------------------------------------------------------------------------------------------------------
// 其他页面接口请求函数
// 登录页面
export const login = (loginpoint, name, pwd) => ajax(BASE_URL + '/fictitious/PostLogin', {
  loginpoint,
  name,
  pwd
}, 'POST')
// 修改密码功能实现
export const modifyPwd = (loginpoint, name, pwd) => ajax(BASE_URL + '/fictitious/PostUpdatePWD', {
  loginpoint,
  name,
  pwd
}, 'POST')
